package com.sm.service;

import java.util.List;

import com.sm.model.IncomeDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sm.dao.IncomeDetailMapper;

@Service
public class IncomeDetailService {

	@Autowired
	private IncomeDetailMapper incomeDetailMapper;

	public List<IncomeDetail> selectByUserId(Integer userId){
		return incomeDetailMapper.selectByUserId(userId);
	}

	public double getSumByUserId(Integer userId) {
		return incomeDetailMapper.getSumByUserId(userId);
	}

	/**
	 * 查给我反钱的人数
	 * @param userId
	 * @return
	 */
	public Integer getUserNumByUserId(Integer userId) {
		return incomeDetailMapper.getUserNumByUserId(userId);
	}
}
